Date.prototype.Format = function(fmt) { //author: meizz
    var o = {
        "M+": this.getMonth() + 1, //月份         
        "d+": this.getDate(), //日         
        "h+": this.getHours() % 12 == 0 ? 12 : this.getHours() % 12, //小时         
        "H+": this.getHours(), //小时         
        "m+": this.getMinutes(), //分         
        "s+": this.getSeconds(), //秒         
        "q+": Math.floor((this.getMonth() + 3) / 3), //季度         
        "S": this.getMilliseconds() //毫秒         
    };
    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
}
const { env, description,platform,PF} = require("../../package.json")
export const RequestUrl = PF[platform][env]["url"];
export const downRequestUrl = PF[platform][env]["downUrl"];
export const ProjectName = PF[platform][env]["name"]
export const CDN = env == "pro" ? "http://47.74.21.66:9946/xlsx/" : "http://192.168.1.89/exportFile/";
// export const ACDN= env == "dev" ?"http://192.168.1.24:9606/storage/":"http://192.168.1.24:9606/storage/";
export const ACDN= RequestUrl +"storage/";


let timerList = new Map();
//1 appVue 资源名称 2 rolePermView权限列表 3 userView.vue 4 indexVue-updateSize 0的话相当于注册一个大于99的type
export const delay = function(callback, ms, type = 1) {
    if (type == 0) {
        type = 99;
        while (timerList.has(parseInt(type))) {
            type++;
        }
    }
    if (timerList.has(parseInt(type))) {
        clearTimeout(timerList.get(parseInt(type)));
    }
    let timer = setTimeout(callback, ms);
    timerList.set(parseInt(type), timer);
    return type;
};